package com.example.demo.service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.demo.dao.MessageDao;
import com.example.demo.entity.Message;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


@Service
public class MessageImpl extends ServiceImpl<MessageDao, Message> implements MessageService {
    @Autowired
    private MessageDao messageDao;

    public void add(Message message) {
        messageDao.insert(message);
    }

    public List<Map<String, Object>> getMessagesByChatRoomId(long id) {
        return messageDao.getMessagesByRoomId(id);
    }

}
